from flask import Blueprint, request, jsonify

bp_test = Blueprint('test', __name__)


@bp_test.route('/sendmoney')
def sendmoney():
    money = request.args.get('money')
    if not money:
        return jsonify({'code': 10011, 'mes': '必须输入金额'})
    else:
        try:
            money = float(money)
        except:
            return jsonify({'code': 10012, 'mes': '格式错误'})

    if money < 200 and money > 0.01:
        return jsonify({'code': 200, 'mes': '格式正确'})
    else:
        return jsonify({'code': 10010, 'mes': '金额不允许'})
